package com.example.imageloader.impl;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.example.imageloader.IImageLoader;
import com.example.imageloader.ImageOptions;
import com.squareup.picasso.Picasso;

public class Glidelmpl implements IImageLoader {


    @Override
    public void loadImage(Context context, Object res, ImageOptions options, ImageView target) {
        RequestBuilder<Drawable> load = null;
        load = Glide.with(context).load(res);



        if (options!=null){
            if (options.getmPlaceImage()>0){
                load.placeholder(options.getmPlaceImage());
            }
            if (options.getmErrorImage()>0){
                load.error(options.getmErrorImage());
            }
        }
      load.into(target);
    }
}

























